package yunquan.wang.modules.base.entity;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import yunquan.wang.base.domain.IdEntity;

@Entity
@Table(name = "BASE_GROUP_TYPE")
public class GroupType extends IdEntity {
   private String name;
   private String info;
   private Integer level;//等级
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "PARENT_ID")
   private GroupType parent;
   @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "parent")
   private List<GroupType> childs;
   @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "groupType")
   private List<GroupInfo> groupInfos;
public String getName() {
	return name;
}
public void setName(String name) {
	this.name = name;
}
public String getInfo() {
	return info;
}
public void setInfo(String info) {
	this.info = info;
}
public Integer getLevel() {
	return level;
}
public void setLevel(Integer level) {
	this.level = level;
}
public GroupType getParent() {
	return parent;
}
public void setParent(GroupType parent) {
	this.parent = parent;
}
public List<GroupType> getChilds() {
	return childs;
}
public void setChilds(List<GroupType> childs) {
	this.childs = childs;
}
public List<GroupInfo> getGroupInfos() {
	return groupInfos;
}
public void setGroupInfos(List<GroupInfo> groupInfos) {
	this.groupInfos = groupInfos;
}
   
}
